package design_pattern.factory.abstract_factory;

/**
 * 用于生产指定的工厂
 *
 * @author 15594
 */
public class FactoryBuilder {
    public static AbstractFactory getFactory(String factoryName){
        switch (factoryName){
            case "color":
                return new ColourFactory();
            case "book":
                return new BookFactory();
            default:
                throw new RuntimeException("没有这个工厂");
        }
    }
}
